package com.msgqer.rchat.client;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

import javax.websocket.Session;

/**
 * 
 * @author keaizhuzhu@公众号：面试怪圈 ;官网地址：{@link http://www.mianshiguaiquan.com}
 *         这里有更多面试、技术、学习资料及源码等
 *
 */
public class ClientGenerator {
	/**
	 * 维护所有的头像，用于生成随机的头像
	 */
	private static List<String> HEADERS = new ArrayList<>();
	/**
	 * 维护所有的名字，用于生成随机的名称
	 */
	private static List<String> NAMES = new ArrayList<>();

	static {
		HEADERS.add("https://semantic-ui.com/images/avatar/small/matt.jpg");
		HEADERS.add("https://semantic-ui.com/images/avatar/small/elliot.jpg");
		HEADERS.add("https://semantic-ui.com/images/avatar/small/jenny.jpg");
		HEADERS.add("https://semantic-ui.com/images/avatar/small/joe.jpg");
		HEADERS.add("https://semantic-ui.com/images/avatar/small/stevie.jpg");
		HEADERS.add("https://semantic-ui.com/images/avatar/small/steve.jpg");
		HEADERS.add("https://semantic-ui.com/images/avatar/small/christian.jpg");
		HEADERS.add("https://semantic-ui.com/images/avatar2/small/molly.png");
		HEADERS.add("https://semantic-ui.com/images/avatar2/small/elyse.png");
		HEADERS.add("https://semantic-ui.com/images/avatar2/small/eve.png");
		HEADERS.add("https://semantic-ui.com/images/avatar2/large/patrick.png");
		HEADERS.add("https://semantic-ui.com/examples/assets/images/avatar/tom.jpg");
		HEADERS.add("https://semantic-ui.com/examples/assets/images/avatar/nan.jpg");
		HEADERS.add("https://semantic-ui.com/images/avatar/small/zoe.jpg");
		HEADERS.add("https://semantic-ui.com/images/avatar/small/nan.jpg");
		HEADERS.add("https://semantic-ui.com/images/avatar/small/ade.jpg");
	}

	static {
		String nameStr = "街机三国\n" + "ㄗs風流』締國︶ㄣ\n" + "冷夫\n" + "。藏茗＂\n" + "火麒麟\n" + "旧忆如夢\n" + "紫雨无声\n" + "念之深谰\n"
				+ "北孤清茶\n" + "师兄゛出招吧\n" + "烈酒摇你个DJ\n" + "堕落天使彡\n" + "彼岸髅灵\n" + "雨落忆回首\n" + "污后姐姐\n" + "阝上辈孑灬Team\n"
				+ "玖梦\n" + "浮巷旧人\n" + "嘴硬欠吻\n" + "∽秀气女孩∽\n" + "烟雨万重\n" + "终极烈火鸟巛Melody\n" + "小眼勾魂\n" + "绽ゞ放姐的魅力\n"
				+ "香初上舞\n" + "点青黛ヽ\n" + "七月的风\n" + "白雨矮碧荷\n" + "涬諨の轉角\n" + "半卷清词\n"
				+ "神魔领域\n" + "碎疏影琼\n" + "红尘浮世\n" + "飞车大王\n" + "散场深拥°\n" + "以我盛夏\n" + "゛青衫水墨つ\n" + "窈窕深谷\n" + "吃饭睡觉打豆豆\n"
				+ "冷紫月\n" + "往事如煙\n" + "冷无心\n" + "丿安萧灬若痕丨轩\n" + "紫涩微凉\n" + "泠菀\n" + "ゐ墨清染\n" + "彼此的伤口\n" + "炫舞妹子\n"
				+ "夏了南城\n" + "只拉勾不上吊\n" + "丿神祈灬丨狂想曲\n" + "┾恋戦℃ャ逍遥\n" + "清莲茉茉\n" + "夏天的鲸鱼梦\n" + "初柚\n" + "失溫旳擁抱▲\n"
				+ "低调洛家\n" + "〇寶╆唄↘噯\n" + "醉雨非烟\n" + "萌比小姐\n" + "手持温柔刀\n" + "丿石门灬独圣\n" + "海和鱼私奔\n" + "丨Vampire丶永恒\n"
				+ "彡炫灬月影萧梦灬\n" + "傲骨依旧\n" + "ミ﹏墨离魂丶\n" + "灰色年华\n" + "￡剑影★留香彡\n" + "浪迹天涯\n" + "风都烫手\n" + "坐看风云起\n"
				+ "青石板梦\n" + "灭世\"轮回\n" + "北柠陌寒\n" + "雨陌\n" + "雨歇梧桐泪\n" + "女神请亮灯\n" + "◇﹎頖縌ジ雄爷\n" + "浪荡成瘾\n" + "云遮断孤独\n"
				+ "清歌留欢\n" + "丿Monster卩s冥彡\n" + "清音悠歌\n" + "静沐暖阳\n" + "雨中晨星\n" + "南城不弯\n" + "懷裏囿風\n" + "茶白\n"
				+ "只是一片海\n" + "决战风云\n" + "夜夏半凉\n" + "流光飞去\n" + "部落守卫战\n" + "夕雾\n" + "||逆天↘浪子丿\n" + "随风长留\n" + "冀殇\n"
				+ "秒爆高手\n" + "华烬\n" + "狼族美少年\n" + "燃烧的小麻雀\n" + "时光为眸\n" + "丿mx传说艹灬急速\n" + "青山灼灼\n" + "暖光浅笑\n" + "忆梦\n"
				+ "灰车党\n" + "霸刀☆藐视天下\n" + "檌噩栤杺\n" + "静谧而安\n" + "心已打烊\n" + "木槿何溪\n" + "北侧少年\n" + "神堂丨灬艹鸳鸯战\n"
				+ "㈠╮丗の悲傷\n" + "蓝色之海\n" + "挽歌\n" + "棾芜\n" + "亡涯\n" + "陌上云幕\n" + "萌系姑凉\n" + "冷心少年\n" + "╬孤独★战使╬\n"
				+ "森林琴声\n" + "ヌ酷还可爱\n" + "为→你锁鈊\n" + "荒者倦睡\n" + "蕴魂刹罗门\n" + "蝶夢灬未醒\n" + "短巷闻雨\n" + "乄龙舞天骄\n" + "生死相随\n"
				+ "十九之夏\n" + "牧以南歌\n" + "南山不寒\n" + "南有孤島\n" + "雅典娜丿灬神话\n" + "几度微凉\n" + "甘之如饴づ\n" + "初秋格子\n" + "湛蓝\n"
				+ "_影丿战魂\n" + "北有亡夢\n" + "南城追浪\n" + "♀卖身╄→葬情♂\n" + "剑血西风\n" + "明月风清\n" + "尘寰未了\n" + "咏恆dē誓誩♂\n"
				+ "斗龙战士\n" + "久爱不腻\n" + "若白如梦\n" + "挽歌半夏\n" + "茶独以酌\n" + "心亦冷\n" + "北①丿战魂\n" + "晴过雨天\n" + "醉酒方知浓\n"
				+ "只做最好的自我\n" + "灵魂虐杀\n" + "偃仰啸歌\n" + "圣气淩人\n" + "曾走过\n" + "鱼雁音书\n" + "丿莫兮丶风流寨丨\n" + "心成森林\n" + "殇忆\n"
				+ "年华无伤\n" + "凉话刺骨\n" + "丿劳资呐喊丶时尚\n" + "妍洋\n" + "≮飘飘★伊人≯\n" + "梦与时光\n" + "ぁ血刹风云城ぁ\n" + "一生不像诗\n"
				+ "初梦良安\n" + "狂飙的蜗牛\n" + "战无不胜\n" + "ら人比心涼\n" + "受伤小潴\n" + "花若相依静\n" + "゛花开逝堇つ\n" + "竹伞轻至\n" + "青空杳然\n"
				+ "沐叶清风\n" + "耳畔风声\n" + "阙歌\n" + "沽酒杯空影\n" + "你行你上啊\n" + "天下我最跩\n" + "花开宿语\n" + "英雄战皇\n" + "″悲箜饮ヽ\n"
				+ "蝶萦\n" + "初梦依旧\n" + "花凌若别离\n" + "北葵向暖\n" + "花朵朵\n" + "女汉子就是天\n" + "一身痞子气\n" + "傲娇的小碎步\n" + "虐身菇凉\n"
				+ "楚楚秋眸\n" + "热血海贼王\n" + "━═☆战メ无情\n" + "彈指間的青春\n" + "浮克旳回音\n" + "灵枫\n" + "踏川逐风\n" + "北秋深悲\n" + "河南车神灬\n"
				+ "橙味少年\n" + "丿星座灬天堂彡\n" + "夏夜凉心\n" + "听风肇事者\n" + "ー個矜持旳小男人\n" + "丶礿子靖ゞ\n" + "虎逼太岁\n" + "麻烦先生\n"
				+ "弹琴↘莫谈情\n" + "马尾少女闪着光\n" + "丿丶渔美人灬钕子\n" + "思╮一世忧伤\n" + "北栀海\n" + "ご绯村★剑心ぃ\n" + "炫靓メ〓征戦\n" + "神仙道\n"
				+ "风晓\n" + "青酥\n" + "静临烟渚\n" + "蝶谷せ追忆\n" + "三木简森迟\n" + "夏至流年\n" + "戮尽逆者\n" + "水清天蓝\n" + "青藤之凉\n"
				+ "￡催命★判官彡\n" + "王者★无双丶\n" + "捉迷藏\n" + "☆刀霸※离伤☆\n" + "月半明时\n" + "空城卜殇\n" + "宁静无风\n" + "魔尤再生\n"
				+ "落葉的秘密\n" + "蓝色激浪\n" + "花落半歌\n" + "右手倒影\n" + "剪剪清风\n" + "南城尾\n" + "墨云压城\n" + "北岛荒°南城空\n" + "清风可相许\n"
				+ "〆﹎兲使雪↘\n" + "半寸时光\n" + "山前听风客\n" + "醉枫染墨\n" + "葬花残云\n" + "﹌°剑尘★纷飞彡\n" + "几度猖狂\n" + "盛夏阑珊\n"
				+ "韶华倾负\n" + "几度枫红\n" + "愛你已過期\n" + "念﹏祤嫣\n" + "猫灵〝\n" + "哥゛天生自然帅\n" + "梅芳竹清\n" + "裸奔的砒霜。\n" + "青石板梦\n"
				+ "风渺\n" + "丿杀手丨炫丶\n" + "火花★之炫\n" + "永恒の翼づ\n" + "柚菀\n" + "Storm风灬晨曦灬\n" + "不冷不热不动情\n" + "柠檬片片\n"
				+ "战魔の不灭\n" + "一世沉浮\n" + "祭祀ら最终一滴泪\n" + "丶丿BW丶神话\n" + "青山隐隐\n" + "惊°世妖娆\n" + "少年玩命不玩心╯\n" + "孤单海岸线\n"
				+ "丨战狂丨灬霸刀\n" + "素爱\n" + "雨梦迟歌\n" + "蒗迹天崖\n" + "半寸时光\n" + "未来的期许\n" + "哥霸气长存\n" + "清风笑烟雨\n" + "大漠祥云\n"
				+ "以剑之名\n" + "陌路孤独\n" + "蓝衣逸竹\n" + "。拙荆＂\n" + "山涧晴岚\n" + "笑着哭最高境界\n" + "素人花裟\n" + "凤栖梧桐\n" + "七喜\n"
				+ "清歌流觞\n" + "寻沫雨悠扬\n" + "与栀\n" + "败镓潇彤\n" + "葑訫ぷ鎖嗳\n" + "涟漪浅漾\n" + "拽拽dě陌小沫\n" + "﹌°追风★樵客彡\n" + "泠月\n"
				+ "温柔判官\n" + "云中歌\n" + "藝彩飛揚\n" + "ぜ火云邪神ぜ\n" + "゛青衫水墨つ\n" + "飞车妹子雄起\n" + "梵音与笙\n" + "称雄三界\n" + "冷青裳\n"
				+ "七分漫舞\n" + "满池千叶莲\n" + "o戰☆無情★\n" + "片刻辰光\n" + "话少情在\n" + "せ道殉霜晨Ж\n" + "清盏孤茶\n" + "血煞帝国\n" + "南风未恋\n"
				+ "非議\n" + "寒冰玄舞\n" + "橘虞初梦\n" + "画碎鱼眠\n" + "简椿\n" + "夜思晨\n" + "神說悲從心中來\n" + "妖孽男神i\n" + "森陌夏栀\n"
				+ "创世兵魂\n" + "予取予求\n" + "￡音乐↘公主ぃ\n" + "别碰我心\n" + "∑gray°鱼ル\n" + "船过水无痕\n" + "朽梦\n" + "森芋暖暖\n" + "初懵\n"
				+ "醉枕江山\n" + "轩哥∥逆天改命\n" + "￡血月★残影﹌\n" + "☆狂舞※天璇☆\n" + "冷妖颜\n" + "逆天\n" + "囍南城鱼\n" + "vip紫炫灬风舞\n"
				+ "赠时光几行情书\n" + "季纪桑弋\n" + "朕，射你无罪\n" + "弦上春雪\n" + "沧澜钓客\n" + "弹弹堂\n" + "好好先森\n" + "月冷花残\n" + "男T台步\n"
				+ "主宰-死神\n" + "池鱼之念\n" + "灵魂操控者\n" + "薀柔尐ㄝ亽\n" + "风吹萤火\n" + "不愛又何必纠缠い\n" + "king丶神袭\n" + "夕陽西下\n"
				+ "可劲胡闹\n" + "紫莹无尘\n" + "梦幻舞步\n" + "朝歌夜弦\n" + "テ妖マ翳ゞ\n" + "一把纸伞碎江南\n" + "傲到骨子里ゝ\n" + "时光倒影\n" + "神妖\n"
				+ "向天★宣战\n" + "忆白\n" + "若舞清风\n" + "风云ㄋ战焰\n" + "◆幻じ灭つ\n" + "不若如初\n" + "丶季末未央。\n" + "九十党\n" + "余生独望\n"
				+ "少年先疯队队长\n" + "问鼎★青龙丶\n" + "往复随安\n" + "浅安时光\n" + "Star丶Drifts家族\n" + "借风凉心\n" + "蛮王灬沐辰\n" + "如梦初醒ら\n"
				+ "心不動則不痛\n" + "我迎着风\n" + "冷月魄\n" + "倚楼听风雨\n" + "时光催心老\n" + "阳光一夏\n" + "桉笙\n" + "灭世狂舞\n" + "抒一封旧长信\n"
				+ "花开宿语\n" + "夏风如歌\n" + "愁绪满风袖\n" + "忆染指夕\n" + "清酒吟\n" + "￡神魔★判官ぃ\n" + "不归浪人\n" + "幽殤\n" + "梦冥\n"
				+ "淡存丶余光\n" + "骑蜗牛追大奔\n" + "皇族鬼圣\n" + "救赎丶上帝\n" + "元芳逆天了\n" + "黑暗战神\n" + "旧城烟雨\n" + "等①衯鍾ゞ\n" + "裸睡の鱼\n"
				+ "蔷薇\n" + "傲剑\n" + "唯愿时光不负°\n" + "游龙战神巛Evonne\n" + "帅到血肉模糊\n" + "琴音似君语\n" + "地域少女\n" + "VIP皇朝风云\n"
				+ "早春的树\n" + "未忘她颜\n" + "朕今晚翻你牌子\n" + "叶舞翩翩\n" + "忆花余香\n" + "火雨冰风\n" + "袖手旁觀\n" + "莫失莫忘\n" + "战芜吥胜\n"
				+ "ゞ灬寒花葬╮\n" + "清风与鹿\n" + "醉酒劍舞\n" + "写意东风事\n" + "ゞ仰望_天空。\n" + "清风清梦\n" + "月夜惊骇\n" + "雪狼\n" + "利刃メ出鞘丶\n"
				+ "爱的薰衣草\n" + "魔龙祭天\n" + "塞外う飛龍\n" + "one丶piece丿r\n" + "放纵流年\n" + "澄成诚程\n" + "梅花疏淡\n" + "爱已归零\n"
				+ "花残念北\n" + "雲卷雲舒\n" + "-心如死灰\n" + "☆神祈灬丨狂想曲\n" + "君醉依然销魂\n" + "薄情少女百毒不侵°\n" + "ャ贱轼天下\n" + "-厕所狂嗨\n"
				+ "焦糖玛奇朵ζ\n" + "弑神丶战殇灬\n" + "青曦\n" + "ミ﹏倾绕莲丶″\n" + "梦回国度\n" + "sky★血狼\n" + "随他飘洋\n" + "丿star炫love绿茶\n"
				+ "夏末浅诗\n" + "寂念流年\n" + "恋夏丨眠彡绝恋\n" + "我爱你若能倒着说\n" + "洛水之南\n" + "杆子帮\n" + "空袭的梦\n" + "淡淡芬芳\n" + "孤独如我\n"
				+ "孤女的伤魂\n" + "月光白\n" + "天青色等烟云\n" + "古木九年\n" + "逗比专业户\n" + "瑾凉\n" + "Smileベ淡莣ァ\n" + "轻抚菊花笑不语\n"
				+ "指破眉間\n" + "花落忆流年\n" + "一夕流年\n" + "樱雨墨落";

		String[] rows = nameStr.split("\n");
		for (String row : rows) {
			NAMES.add(row);
		}
	}

	/**
	 * 生成一个客户端
	 * 
	 * @return
	 */
	public static Client gen(Session session) {
		Client client = new Client();
		client.setClientId(session.getId());
		client.setSession(session);
		client.setClientHeader(HEADERS.get(new Random().nextInt(HEADERS.size())));
		client.setClientName(NAMES.get(new Random().nextInt(NAMES.size())));
		return client;
	}

}
